/*
 * @Author: guxf
 * @Date: 2021-11-25 12:47:22
 * @Description: 用户相关接口
 */
import request from "@/utils/request.js";
const api = {
  page: '/merchant/order/page',
  addOrUpdate: '/merchant/goods/addGoods',
  deleteById: '/merchant/order/deleteOrder/',
  queryNewMemberGift: '/applet/homeDetails/queryNewMemberGift' ,    //查询新人礼
  receiveNewMemberGift: '/applet/homeDetails/receiveNewMemberGift', //领取新人礼
}
export function page(parameter) {
  return request({
    url: api.page,
    method: 'post',
    data: parameter
  })
}
/**
 * @desc 新增或刪除
 */
export function addOrUpdate(data) {
  return request({
    method: "POST",
    url: api.addOrUpdate,
    data,
  });
}
export function deleteById(parameter) {
	return request({
	  method: "delete",
	  url: api.deleteById + parameter,
	});
}

// 查询轮播图
export function getBanner(parameter) {
	return request({
	  method: "GET",
	  url: '/applet/homeDetails/getHomeList',
	});
}
// 查询首页商品
export function getHome(t) {
	return request({
	  method: "GET",
	  url: '/applet/PageData/getPageData',
	});
}


// 查询首单礼
// export function getFirst(t) {
// 	return request({
// 	  method: "GET",
// 	  url: '/applet/homeDetails/getFirstGift',
// 	});
// }
export function queryNewMemberGift() {
	return request({
		method: "GET",
		url: api.queryNewMemberGift
	})
}

export function receiveNewMemberGift() {
	return request({
		method: "POST",
		url: api.receiveNewMemberGift
	})
}